Skip to content

sql-150: Create test suite for durable temporary objects - #38159

Merged
SangJunBak merged 3 commits into
mainfrom
jun/move-temp-to-catalog-split-3
Aug 20, 2026
Merged

sql-150: Create test suite for durable temporary objects#38159
SangJunBak merged 3 commits into
mainfrom
jun/move-temp-to-catalog-split-3

Conversation

@SangJunBak

Copy link
Copy Markdown
Contributor

Creates a more in-depth test suite for implementation, included unit tests at the persist level and e2e tests at the mzcompose level to replicate killing a process

Motivation

sql-150

Description

catalog: test ephemeral item reclamation in the durable layer

Temporary items are durable items tagged with the UUID of the session that created them. Neither of the two mechanisms holding that together had any coverage.

  • read-write: name uniqueness is scoped by the owning session, so two sessions can each hold a tt in the sentinel temporary schema while one session cannot hold it twice. remove_ephemeral_items then reclaims all of them and leaves normal items alone, which matters because an over-broad filter there would silently delete real user items.
  • open: a writable open reclaims a temporary item left behind by a process that died without closing its session, which is the only thing between a kill -9 and a permanently leaked catalog item. A read-only open must not, since a zero-downtime follower reads the leader's catalog while the leader's sessions are still live and still own theirs. The read-only case is checked before the writable one, so the ordering makes both directions observable.

test: cover temporary item cleanup on session close and kill -9

Temporary tables and views are durable catalog items tagged with their owning session, so they need cleanup on both paths out of a session, and neither path had a test. The only existing temp-teardown coverage is DISCARD TEMP / DISCARD ALL, which is a different code path.

test: cover 0dt preflight behavior for temporary items

Ensure creating temporary items during a 0dt upgrade doesn't cause a halt. This is already the case because even though these temporary objects are public to all envds, we clear them from the snapshot whenever we open the catalog not in readonly mode.

@SangJunBak
SangJunBak requested a review from a team as a code owner August 11, 2026 14:19
@SangJunBak SangJunBak changed the title catalog: test ephemeral item reclamation in the durable layer sql-150: Create test suite for durable temporary objects Aug 11, 2026
@SangJunBak
SangJunBak requested a review from mtabebe August 11, 2026 14:20
@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown

SQL-150

@SangJunBak
SangJunBak force-pushed the jun/move-temp-to-catalog-split-3 branch from 75ed78e to fdbfc0e Compare August 13, 2026 01:35

@def- def- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for extra tests!

@SangJunBak
SangJunBak requested review from a team as code owners August 13, 2026 14:06
@SangJunBak
SangJunBak force-pushed the jun/move-temp-to-catalog-split-3 branch from fdbfc0e to 536c534 Compare August 13, 2026 15:19

@mtabebe mtabebe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the tests 🫡

stack merge was automatically disabled August 13, 2026 21:08

Pull Request is not mergeable

stack merge was automatically disabled August 13, 2026 21:16

Pull Request is not mergeable

@SangJunBak
SangJunBak force-pushed the jun/move-temp-to-catalog-split-3 branch from 536c534 to 61c1367 Compare August 14, 2026 16:07
@SangJunBak
SangJunBak force-pushed the jun/move-temp-to-catalog-split-3 branch 2 times, most recently from 450068c to de28215 Compare August 17, 2026 17:58
@SangJunBak
SangJunBak force-pushed the jun/move-temp-to-catalog-split-3 branch from de28215 to 30f8ef7 Compare August 17, 2026 19:35
@SangJunBak
SangJunBak force-pushed the jun/move-temp-to-catalog-split-3 branch from 30f8ef7 to de0a1f8 Compare August 19, 2026 19:00
Base automatically changed from jun/move-temp-to-catalog-split-2 to main August 19, 2026 20:34
@SangJunBak
SangJunBak requested a review from a team as a code owner August 19, 2026 20:34
Temporary items are durable items tagged with the UUID of the session
that created them. Neither of the two mechanisms holding that together
had any coverage.

read-write: name uniqueness is scoped by the owning session, so two
sessions can each hold a 'tt' in the sentinel temporary schema while one
session cannot hold it twice. remove_ephemeral_items then reclaims all of
them and leaves normal items alone, which matters because an over-broad
filter there would silently delete real user items.

open: a writable open reclaims a temporary item left behind by a process
that died without closing its session, which is the only thing between a
kill -9 and a permanently leaked catalog item. A read-only open must not,
since a zero-downtime follower reads the leader's catalog while the
leader's sessions are still live and still own theirs. The read-only case
is checked before the writable one, so the ordering makes both directions
observable.
Temporary tables and views are durable catalog items tagged with their
owning session, so they need cleanup on both paths out of a session, and
neither path had a test. The only existing temp-teardown coverage is
DISCARD TEMP / DISCARD ALL, which is a different code path.
Ensure creating temporary items during a 0dt upgrade doesn't cause a halt. This is already the case because even though these temporary objects are public to all envds, we clear them from the snapshot whenever we open the catalog not in readonly mode.
@SangJunBak
SangJunBak force-pushed the jun/move-temp-to-catalog-split-3 branch from de0a1f8 to 75f805c Compare August 19, 2026 20:34
@SangJunBak
SangJunBak merged commit ad71b6d into main Aug 20, 2026
82 checks passed
@SangJunBak
SangJunBak deleted the jun/move-temp-to-catalog-split-3 branch August 20, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants